﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using TianShiProject.Models.Common;

namespace TianShiProject.Models.BaseInfo.Cars
{
    public class CarDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 车辆编号
        /// </summary>
        public string CarNumber { get; set; }
        /// <summary>
        /// 厂牌型号
        /// </summary>
        [Required(ErrorMessage ="请输入厂牌型号")]
        public string CarBrand { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        public string License { get; set; }
        /// <summary>
        /// 司机名称
        /// </summary>
        [Required(ErrorMessage = "请输入司机名称")]
        public string DriverName { get; set; }
        /// <summary>
        /// 所属公司
        /// </summary>
        public int CompanyId { get; set; }
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { get; set; }
        /// <summary>
        /// 车型
        /// </summary>
        public string CarType { get; set; }
        /// <summary>
        /// 车辆颜色
        /// </summary>
        public string CarColor { get; set; }
        /// <summary>
        /// 购置日期
        /// </summary>
        //[JsonConverter(typeof(JsonDateConverter))]
        public DateTime PurchaseTime { get; set; }
        public string PurchaseTimes { get { return PurchaseTime.ToString("yyyy-MM-dd"); } }
        /// <summary>
        /// 营运证号
        /// </summary>
        [Required(ErrorMessage = "请输入营运证号")]
        public string MarketingNumber { get; set; }
        /// <summary>
        /// 保险到期时间
        /// </summary>
        public DateTime ExpiryTime { get; set; }
        public string ExpiryTimes { get { return ExpiryTime.ToString("yyyy-MM-dd"); } }
        /// <summary>
        /// 年检到期时间
        /// </summary>
        public DateTime CheckTime { get; set; }
        public string CheckTimes { get { return CheckTime.ToString("yyyy-MM-dd"); } }
        /// <summary>
        /// 保养公里数设置
        /// </summary>
        public string Kilometre { get; set; }
        /// <summary>
        /// 车辆照片
        /// </summary>
        public string CarImg { get; set; }
        /// <summary>
        /// 保险卡照片
        /// </summary>
        public string ExpiryImg { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public int IsDelete { get; set; }
    }
}
